﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using qiupeng.Public;
using System.IO;

public partial class OpenWindows_open_Respon : System.Web.UI.Page
{
    Db List = new Db();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            name.Attributes["onkeydown"] = "if (event.keyCode==13) { document.all.Button4.click(); return false;}";
            requeststr.Text = Server.UrlDecode(Request.QueryString["requeststr"].ToString());
        }
        DataBindToGridview();
    }

    public void DataBindToGridview()
    {
        string strWhere = "";

        switch (Session["ResponseRemark"].ToString())
        {
            
            case "区队":
                strWhere += " and id not in ('1','10') ";
                break;
            case "矿级":
                strWhere += " and id not in ('1')   ";
                break;
        }


        if (Request.QueryString["str"] != null)
        {
            string SQL_GetList_xs = "select * from qp_hr_Respon where  name like '%" + Server.UrlDecode(Request.QueryString["str"]) + "%'" + strWhere;
            GridView1.DataSource = List.GetGrid_Pages_not(SQL_GetList_xs);
            GridView1.DataBind();

        }
        else
        {
            string SQL_GetList_xs = "select * from qp_hr_Respon where 1=1 " + strWhere;
            GridView1.DataSource = List.GetGrid_Pages_not(SQL_GetList_xs);
            GridView1.DataBind();

        }





    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        DataBindToGridview();
        this.GridView1.DataBind();
    }

    protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("open_Respon.aspx?str=" + name.Text + "&requeststr=" + Server.UrlDecode(Request.QueryString["requeststr"].ToString()) + "");
    }
}
